//
//  NewsTableViewCell.m
//  XIWenLeJian
//
//  Created by lanou3g on 15/11/12.
//  Copyright © 2015年 蓝足. All rights reserved.
//

#import "NewsTableViewCell.h"
#import "NewsModel.h"
@interface NewsTableViewCell ()

@property (nonatomic ,weak) UILabel *titleLabel;

@end

@implementation NewsTableViewCell


//初始化子控件
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        
        UILabel *label = [[UILabel alloc] init];
        
        label.backgroundColor = [UIColor blueColor];
        
        label.font = [UIFont systemFontOfSize:15];
        
        label.adjustsFontSizeToFitWidth = YES;
        
        [self.contentView addSubview:label];
        
        self.titleLabel = label;
        
    }
    
    return self;
}

//布局子控件
- (void)layoutSubviews
{
    [super layoutSubviews];
    
    self.titleLabel.frame = CGRectMake(10, 10, 100, 30);
    
}

- (void)setModel:(NewsModel *)model
{
    _model = model;
    
    self.titleLabel.text = self.model.name;
}



- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
